from django.shortcuts import render
from django.http import JsonResponse,HttpResponseRedirect
from rest_framework.views import APIView
from rest_framework.response import Response
from .models import *

# Create your views here.
class Login(APIView):
    def post(self,request):
        data = request.data
        name = data['name']
        password = data['password']
        print(data)
        TestRole.objects.create(name=name)
        return Response({"code":200})